import pandas as pd
list=[[110,120,105],[95,110,108],[98,80,100],[112,106,97]]
index=['王猛','李珊','赵胜','刘文']
columns=['语文','数学','英语']
df=pd.DataFrame(list,index,columns)
print('原始数据:\n',df)
print('选取王猛的所有成绩:\n',df.iloc[0])
print('选取王猛和刘文的所有成绩:\n',df.iloc[[0,3]])
print('选取王猛到赵胜所有成绩:\n',df.iloc[0:3])
print('选取王猛和赵胜的语文成绩和数学成绩:\n', df.iloc[[0,2],[0,1]])
print('选取王猛到赵胜的语文和英语和成绩:\n',df.iloc[0:3,[0,1]])
print('选取成绩:\n',df.iloc[:,[0,2]])
print('选取成绩:\n',df.iloc[:,[0]])
print('选取成绩:\n',df.iat[0,1])
